<?php
namespace addon\cms\validate;
use app\common\validate\ValidateBase;
class MiniProgramColumn extends ValidateBase
{
    // 验证规则
    protected $rule = [
        'title'                 => 'require|unique:MiniProgramColumn',
        'img'                   => 'require',
        'url'                   => 'require'
    ];

    // 验证提示
    protected $message = [
        'title.require'         => '栏目标题必须',
        'title.unique'          => '栏目标题已存在',
        'img.require'           => '图标必须',
        'url.require'           => '链接地址必须',
    ];

    // 应用场景
    protected $scene = [
        'add_edit'  =>  ['title','img'],
    ];
}